package cn.ad.enumration;

import java.util.Map;

public enum Age {
	AGE14ANDLESS("14岁及以下",1),//	'14岁及以下',
	AGE15TO18("15-18岁",2),//	'15-18岁',
	AGE19TO24("19-24岁",4),//	'19-24岁',
	AGE25TO30("25-30岁",8),//	'25-30岁',
	AGE31TO35("31-35岁",16),//	'31-35岁',
	AGE36TO40("36-40岁",32),//	'36-40岁',
	AGE41TO45("41-45岁",64),//	'41-45岁',
	AGE46TO50("46-50岁",128),//	'46-50岁',
	AGE51TO55("51-55岁",256),//	'51-55岁',
	AGE56TO60("56-60岁",512),//	'56-60岁',
	AGE61TO64("61-64岁",1024),//	'61-64岁',
	AGE65ANDTHAN("65岁及以上",2048);//	'65岁及以上'
	
    private String name;
    private int value;
    
    private static java.util.HashMap<String,Integer> mappings;

    private synchronized static java.util.HashMap<String, Integer> getMappings() {
        if (mappings == null) {
            mappings = new java.util.LinkedHashMap<String, Integer>();
            for (Age format : Age.values()) {
                mappings.put(format.name, format.value);
            }
        }
        return mappings;
    }

    private Age(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

	public int getValue() {
		return value;
	}
	 public static Map<String,Integer> getMapping(){
	        return getMappings();
	 }
}
